#![allow(unused_variables)]
fn main() {
    // * if...else...
    {
        let number = 3;

        if number < 5 {
            println!("condition was true");
        } else {
            println!("condition was false");
        }
    }
    // * if 赋值
    {
        let condition = true;
        let number = if condition { 5 } else { 6 };
        println!("The value of number is: {}", number);
    }
    // * loop循环
    {
        let mut counter = 0;
        let result = loop {
            counter += 1;
            if counter == 10 {
                break counter * 2;
            }
        };
        println!("The result is {}", result);
    }
    // * while循环
    {
        let mut number = 3;
        while number != 0 {
            println!("{}!", number);
            number -= 1;
        }
        println!("LIFTOFF!!!");
    }
    {
        let a = [10, 20, 30, 40, 50];

        for element in a.iter() {
            println!("the value is: {}", element);
        }
    }
}
